<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>03_事件</title>
    <script type="text/javascript" src="js/vue.js"></script>
</head>

<body>
    <div class="root">
        <h2>欢迎来到{{name}}学习</h2>
        <button v-on:click="showInfo">点我提示信息</button>
        <button @click="showInfo1($event,number)">点我提示信息</button>
    </div>
    <script type="text/javascript">
        var root = new Vue({
            el: '.root',
            data: {
                name: 'Vue'
            },
            methods: {
                showInfo: function () {
                    alert('欢迎来到' + this.name + '学习');
                },
                showInfo1: function (event, number) {
                    console.log(event, number)
                    alert('欢迎来到' + this.name + '111学习');
                }
            }
        });
    </script>
</body>

</html>